import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userPhoto: 'https://p5.ssl.qhimgs1.com/t01ba6ea141fbcb6e8f.jpg', // 头像地址(默认值),
    userName: ''
  },
  getters: {
  },
  mutations: {
    // 编码风格：mutations最好大写，有区分
    // 修改头像
    SET_USERPHOTO(state, value) {
      state.userPhoto = value
    },
    // 修改名字
    SET_USERNAME(state, value) {
      state.userName = value
    }
  },
  actions: {
  },
  modules: {
  }
})
